import React from 'react';
import './App.css';
import { connect } from 'react-redux'
import { addGun, removeGun, addGunAsync } from './index.redux'

@connect(
  // 你要state什么属性，放在props里
  state => ({num: state}),
  // 你要什么方法，放到props里，自动dispatch
  { addGun, removeGun, addGunAsync}
)
class App extends React.Component {
  render(){
    return (
      <div className="App">
        333
        {/* <h2>现在有机枪{this.props.num}把</h2>
        <button onClick={this.props.addGun}>加机关枪</button>
        <button onClick={this.props.removeGun}>减机关枪</button>
        <button onClick={this.props.addGunAsync}>异步加关枪</button> */}
      </div>
    );
  }
}

export default App;
